package sky.springcloud.eurekahello.controller;

import com.netflix.appinfo.EurekaInstanceConfig;
import com.netflix.discovery.EurekaClientConfig;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    @Autowired
    EurekaInstanceConfig config;

    @RequestMapping("hello")
    public String hello() {
        return config.getHostName(true);
    }
}
